{% extends "base.html" %}
{% block title %}登录{% endblock %}
{% block content %}
<style>
  /* 页面背景渐变，适配设计风格 */
  body {
    /* 从浅紫到深紫的渐变，贴合设计图色调 */
    background: linear-gradient(135deg, #c3c9ff 0%, #7b58e0 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
  }
  /* 表单外层容器，模拟设计图的卡片+阴影效果 */
  .login-container {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    width: 400px;
    padding: 30px;
    /* 给容器添加简单的 hover 上浮动效 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  .login-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  }
  /* 标题样式，让文字更贴合设计图居中且清晰 */
  h2.text-center.mb-4 {
    color: #333;
    font-weight: 600;
    margin-bottom: 24px !important;
  }
  /* 输入框样式优化，让输入区域更精致 */
  .form-control {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 14px;
    transition: border-color 0.3s ease;
  }
  .form-control:focus {
    border-color: #7b58e0;
    box-shadow: 0 0 0 2px rgba(123, 88, 224, 0.1);
  }
  /* 按钮样式，改成设计图里的紫色渐变 */
  .btn-primary {
    background: linear-gradient(135deg, #7b58e0 0%, #603aba 100%);
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-weight: 600;
    transition: transform 0.3s ease, background 0.3s ease;
  }
  .btn-primary:hover {
    background: linear-gradient(135deg, #603aba 0%, #4b2a99 100%);
    transform: scale(1.02);
  }
  /* 注册链接样式调整 */
  .mt-3.text-center a {
    color: #7b58e0;
    text-decoration: none;
    transition: color 0.3s ease;
  }
  .mt-3.text-center a:hover {
    color: #603aba;
    text-decoration: underline;
  }
</style>

<!-- 新增外层容器，用于实现卡片效果 -->
<div class="login-container">
  <h2 class="text-center mb-4">天气数据分析可视化系统</h2>
  <form method="POST">
    {{ form.hidden_tag() }}
    <div class="mb-3">
      {{ form.username.label(class="form-label") }}
      {{ form.username(class="form-control") }}
    </div>
    <div class="mb-3">
      {{ form.password.label(class="form-label") }}
      {{ form.password(class="form-control") }}
    </div>
    <div class="d-grid">
      {{ form.submit(class="btn btn-primary") }}
    </div>
    <div class="mt-3 text-center">
      <a href="{{ url_for('auth.register') }}">没有账号？立即注册</a>
    </div>
  </form>
</div>

{% endblock %}